using UnityEngine;
using UnityEngine.UI;

namespace Gj
{
    public class SwitchItemHelper : NodeHelper
    {
        public SwitchHelper SwitchHelper;
        private Button _Button;

        protected Button Button
        {
            get
            {
                if (_Button == null) _Button = UnityTools.GetComponentRequire<Button>(gameObject);
                return _Button;
            }
        }

        protected override void Start()
        {
            if (Button != null) Button.onClick.AddListener(SwitchHelper.Switch);
        }
    }
}